package thinkingJava.chapter14;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class LiteralPetCreater extends PetCreater {
	@SuppressWarnings("unchecked")
	public static final List<Class<? extends Pet>> allTypes =
		Collections.unmodifiableList(Arrays.asList(
				Pet.class, Dog.class, Cat.class, Rodent.class,
				Mutt.class, Pug.class, EgyptianMau.class, Hamster.class,
				Cymric.class, Manx.class, Mouse.class, Rat.class));
	private static final List<Class<? extends Pet>> types =
		allTypes.subList(allTypes.indexOf(Mutt.class),allTypes.size());
	public List<Class<? extends Pet>> types() {
		return types;
	}
	public static void main(String[] args) {
		System.out.println(types);
		for (Class c : types) {
			System.out.println(c.getName());
		}
	}
}
